#include <iostream>
#include <memory>  //智能指针对应的头文件
#include <string.h>
using namespace std;

/*
	
*/
struct student
{
	char name[10];
	int age;
};

class Cat
{
public:	
	void catchMouse()
	{
		cout<<"猫抓老鼠"<<endl;
	}
};

int main()
{
	auto_ptr<struct student> p1(new struct student);
	auto_ptr<Cat> p2(new Cat);
	
	//往堆空间存放数据
	//正确的：auto_ptr重载了解引用
	strcpy(p1->name,"张三");
	p1->age=18;
	
	p2->catchMouse();
	(*p2).catchMouse();
	return 0;
}